﻿using System;
using BinarySerialization;

namespace EditMode
{
    /// <summary> 
    /// Target structure used in F 2nd edit mode. 
    /// </summary>
    [Serializable]
    public class EditTarget
    {
        /// <summary> Bar the target is positioned in. </summary>
        [FieldOrder(0)]
        public ushort BarIndex { get; set; }

        /// <summary> Position within the current bar of the target. </summary>
        [FieldOrder(1)]
        public ushort BeatIndex { get; set; }

        /// <summary> Unknown property. Differnt for F edits. </summary>
        [FieldOrder(2)]
        public ushort Unknown { get; set; } = 0x0100;
        
        /// <summary> Unknown property, resets to 0x0100 after saving an edit. </summary>
        [FieldOrder(3)]
        public ushort ConstUnknown { get; set; } = 0x0100;

        /// <summary> Type of target. </summary>
        [FieldOrder(4)]
        public TargetType TargetType { get; set; } = TargetType.maru;

        /// <summary> Target X-position. </summary>
        [FieldOrder(5)]
        public float XPosition { get; set; } = 640;

        /// <summary> Target Y-position. </summary>
        [FieldOrder(6)]
        public float YPosition { get; set; } = 352;

        /// <summary> Target fly entry angle. </summary>
        [FieldOrder(7)]
        public float EntryAngle { get; set; } = 0x00;

        /// <summary> Bar in which a hold target ends. </summary>
        [FieldOrder(8)]
        public ushort HoldEndBar { get; set; } = 0x00;

        /// <summary> Position in bar in which a hold target ends. </summary>
        [FieldOrder(9)]
        public ushort HoldEndBeat { get; set; } = 0x00;
    }
}
